<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Home\Model;
use Think\Model\RelationModel;
/**
 * Description of EggsController
 *
 * @author v
 */
class EggsModel extends RelationModel{
    public $_link=array(
        'where'=>array(
            'mapping_type'=>self::HAS_MANY,
            'mapping_name'=>'where',
            'class_name'  =>'eggs_where',
            'foreign_key' =>'eid',
            'condition'   =>'1=1 ',
            'mapping_order'=>'isdefault desc,id asc'
        )
    );
    
    /*
     * $where is string
     */
    public function setCondition($where){
        $this->_link['where']['condition'].=$where;
    }
}
